/* static/styles.css */
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
    height: 100%; /* Ensure html also has height for body 100% to work if vh isn't used */
    overflow-x: hidden; /* 防止水平滚动 */
  }
  
  body {
    /* Wallpaper with subtle overlays for texture and atmosphere */
    background-image: 
      /* Top layer: Noise Texture (subtle) */
      url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.1'/%3E%3C/svg%3E"), /* Opacity 0.06 -> 0.1 */
      /* Middle layer: Subtle Cool Gray Gradient (for mist effect) */
      linear-gradient(120deg, rgba(170, 180, 190, 0.05), rgba(140, 150, 165, 0.08)), /* Alpha 0.02-0.04 -> 0.05-0.08 */
      /* Bottom layer: Your 4K Wallpaper */
      url("/images/9d55360de3e4671e250d98139ce19cea.jpeg");
    
    background-size: auto, auto, cover; /* MODIFIED: wallpaper to cover */
    background-position: 0 0, 0 0, center top; /* 修改为top以避免底部延伸 */
    background-repeat: repeat, no-repeat, no-repeat; 
    background-attachment: fixed; 
    background-color: #333a45; /* Kept for extreme aspect ratios, mostly covered by image now */
    
    /* 移除溢出控制，默认允许滚动 */
    min-height: 100%;
    max-height: unset; /* 移除高度限制，允许正常滚动 */
    overflow-y: auto; /* 默认允许滚动 */
    overflow-x: hidden; /* 防止水平滚动 */
    
    /* Height and overflow will be controlled by a specific class for homepage */
    /* @apply bg-gradient-to-b from-surface-50 via-surface-100 to-primary-50/60; */
  }
  
  /* New class for homepage fullscreen, no-scroll effect */
  body.body-fullscreen-no-scroll {
    height: 100vh;
    overflow-y: hidden !important;
  }
  
  ::selection {
    @apply bg-primary-300/40 text-primary-900;
  }
  
  /* Elegant heading typography */
  h1, h2, h3, h4 {
    @apply text-surface-900 font-display tracking-tight;
  }

  h1 {
    @apply text-4xl sm:text-5xl font-medium leading-tighter;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
  }

  h2 {
    @apply text-3xl font-medium leading-tighter;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6); /* Adjusted shadow for potentially darker backgrounds */
  }

  h3 {
    @apply text-2xl font-medium;
  }

  h4 {
    @apply text-xl font-medium;
  }
  
  /* Refined text link styles */
  a {
    @apply text-primary-800 transition-colors duration-300;
  }
  
  a:hover {
    @apply text-primary-600;
  }
}

@layer components {
  /* 精致的分隔线 */
  .divider {
    @apply h-px w-full bg-gradient-to-r from-transparent via-surface-800 to-transparent my-8 opacity-60;
  }
  
  /* 高级卡片样式 */
  .card {
    @apply bg-surface-900/60 backdrop-blur-sm border border-surface-800/50 rounded-lg overflow-hidden shadow-subtle;
    position: relative;
  }
  
  .card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(to top, transparent, rgba(255, 255, 255, 0.03));
    -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
    mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
  }
  
  .card-hover {
    @apply transition-all duration-300 hover:shadow-lg hover:-translate-y-0.5 hover:bg-surface-800/50;
  }
  
  /* 精致的输入框 */
  .input {
    @apply bg-white text-surface-900 border border-surface-200 rounded-lg px-4 py-2.5 w-full placeholder-surface-500
    transition-all duration-200 outline-none focus:border-primary-400 focus:ring-1 focus:ring-primary-400/20;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
  }
  
  .textarea {
    @apply input resize-y min-h-[100px];
  }
  
  /* 按钮系列 */
  .btn {
    @apply inline-flex items-center justify-center gap-2 rounded-lg text-sm font-medium transition-all duration-300 select-none
    focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/40
    disabled:opacity-50 disabled:pointer-events-none;
    position: relative;
    overflow: hidden;
  }
  
  .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.2),
      transparent
    );
    transition: left 0.7s ease;
  }
  
  .btn:hover::before {
    left: 100%;
  }
  
  .btn::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    transition: opacity 0.4s ease;
    pointer-events: none;
  }
  
  .btn:hover::after {
    opacity: 1;
  }
  
  .btn:active {
    transform: translateY(1px) scale(0.98);
    transition: transform 0.2s ease;
  }
  
  .btn-primary {
    @apply text-white bg-gradient-to-r from-primary-600 to-primary-500 shadow-sm hover:shadow-md;
  }
  
  .btn-secondary {
    @apply bg-surface-800 text-surface-200 hover:bg-surface-700;
  }
  
  .btn-outline {
    @apply bg-transparent border border-surface-300 text-surface-700 hover:bg-primary-50/50 hover:border-primary-300 hover:text-primary-700;
  }
  
  .btn-ghost {
    @apply bg-transparent text-surface-400 hover:bg-surface-800/50 hover:text-surface-300;
  }
  
  /* 按钮尺寸 */
  .btn-sm {
    @apply h-8 px-3 text-xs;
  }
  
  .btn-md {
    @apply h-9 px-4 text-sm;
  }
  
  .btn-lg {
    @apply h-10 px-6 text-base;
  }
  
  /* 头像组件 */
  .avatar {
    @apply rounded-full overflow-hidden flex items-center justify-center bg-surface-800;
  }
  
  /* 徽章组件 */
  .badge {
    @apply inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium;
  }
  
  .badge-primary {
    @apply bg-primary-500/10 text-primary-400;
  }
  
  .badge-success {
    @apply bg-accent-emerald/10 text-accent-emerald;
  }
  
  .badge-warning {
    @apply bg-accent-amber/10 text-accent-amber;
  }
  
  .badge-danger {
    @apply bg-accent-rose/10 text-accent-rose;
  }

  /* 精致的磨砂玻璃效果 */
  .glass-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.75rem;
    box-shadow: 
      0 8px 20px rgba(0, 0, 0, 0.1),
      0 0 15px rgba(200, 200, 255, 0.15),
      0 0 25px rgba(200, 200, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    z-index: 3;
  }
  
  .glass-card:hover {
    transform: translateY(-4px) scale(1.01);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 
      0 12px 25px rgba(0, 0, 0, 0.12),
      0 0 20px rgba(200, 200, 255, 0.25),
      0 0 35px rgba(200, 200, 255, 0.2);
  }
  
  /* 发光边框效果基础 */
  .glow-border {
    position: relative;
    overflow: visible;
    transition: transform 0.4s ease, border 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3); /* 初始状态就有一个明显的边框 */
  }
  
  /* 悬停时的基础效果 */
  .glow-border:hover {
    transform: translateY(-3px);
    border-width: 2.5px !important; /* 悬停时边框变粗 */
  }
  
  /* 不同颜色的边框效果 */
  .glow-border:nth-child(5n+1):hover {
    border-color: rgba(245, 158, 11, 0.5) !important; /* 增加颜色不透明度 */
    box-shadow: 
      0 10px 25px rgba(0, 0, 0, 0.06), /* 增强阴影 */
      0 0 0 2px rgba(245, 158, 11, 0.5), /* 加粗边框线 */
      0 0 20px rgba(245, 158, 11, 0.3); /* 增强发光效果 */
  }
  
  .glow-border:nth-child(5n+2):hover {
    border-color: rgba(16, 185, 129, 0.5) !important;
    box-shadow: 
      0 10px 25px rgba(0, 0, 0, 0.06),
      0 0 0 2px rgba(16, 185, 129, 0.5),
      0 0 20px rgba(16, 185, 129, 0.3);
  }
  
  .glow-border:nth-child(5n+3):hover {
    border-color: rgba(124, 58, 237, 0.5) !important;
    box-shadow: 
      0 10px 25px rgba(0, 0, 0, 0.06),
      0 0 0 2px rgba(124, 58, 237, 0.5),
      0 0 20px rgba(124, 58, 237, 0.3);
  }
  
  .glow-border:nth-child(5n+4):hover {
    border-color: rgba(239, 68, 68, 0.5) !important;
    box-shadow: 
      0 10px 25px rgba(0, 0, 0, 0.06),
      0 0 0 2px rgba(239, 68, 68, 0.5),
      0 0 20px rgba(239, 68, 68, 0.3);
  }
  
  .glow-border:nth-child(5n+5):hover {
    border-color: rgba(59, 130, 246, 0.5) !important;
    box-shadow: 
      0 10px 25px rgba(0, 0, 0, 0.06),
      0 0 0 2px rgba(59, 130, 246, 0.5),
      0 0 20px rgba(59, 130, 246, 0.3);
  }
  
  /* 鼠标光晕效果 */
  .cursor-glow {
    position: fixed;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: rgba(126, 156, 214, 0.15);
    backdrop-filter: blur(2px);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
    mix-blend-mode: screen;
    box-shadow: 0 0 10px rgba(126, 156, 214, 0.3);
  }
  
  .cursor-glow-active {
    width: 50px;
    height: 50px;
    background-color: rgba(126, 156, 214, 0.25);
    box-shadow: 0 0 20px rgba(126, 156, 214, 0.5);
  }
  
  /* 诗意的卡片效果 */
  .poetic-card {
    @apply rounded-xl p-6 transition-all duration-300;
    position: relative;
    overflow: hidden;
    background: white;
    backdrop-filter: blur(12px);
    box-shadow: 
      0 4px 20px -5px rgba(97, 87, 72, 0.15),
      0 0 0 1px rgba(255, 255, 255, 0.9),
      inset 0 0 20px rgba(255, 255, 255, 0.5);
  }
  
  .poetic-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
      circle at top right,
      rgba(163, 191, 217, 0.15) 0%,
      transparent 70%
    );
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
  }
  
  .poetic-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.5px;
    background: linear-gradient(
      135deg,
      transparent,
      rgba(255, 255, 255, 0.5) 40%,
      rgba(163, 191, 217, 0.2) 60%,
      transparent
    );
    -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
    mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
  }
  
  .poetic-card:hover {
    transform: translateY(-4px);
    box-shadow: 
      0 20px 40px -10px rgba(97, 87, 72, 0.15),
      0 0 0 1px rgba(255, 255, 255, 0.9),
      inset 0 0 30px rgba(255, 255, 255, 0.5),
      0 0 0 4px rgba(163, 191, 217, 0.1);
  }
  
  .poetic-card:hover::before {
    opacity: 0.8;
  }
  
  .poetic-card:hover::after {
    opacity: 0.8;
  }
  
  /* 更新博客卡片样式 */
  .blog-card {
    @apply glass-card glow-border rounded-lg py-4 px-5;
    position: relative;
    margin-bottom: 0.5rem;
    z-index: 5;
    background-color: rgba(255, 255, 255, 0.7);
  }
  
  /* --- NEW STYLES FOR BLOG CARD TITLE AND CONTENT --- */
  /* Default blog card title style (larger font) */
  .blog-card h2 { /* Targeting h2 as per user screenshot */
    @apply text-2xl font-semibold mb-2; /* Tailwind: text-2xl is 24px. mb-2 is 0.5rem margin */
  }

  .blog-card h2 a { /* Targeting the <a> tag within h2 for color */
    /* @apply transition-colors duration-300; */ /* Temporarily comment out for testing */
    
    /* Diagnostic Style: Make all titles LIME GREEN and BOLD */
    color: lime !important;
    font-weight: bold !important; 
    font-size: 22px !important; /* Make size distinct too */

    /* The color will be explicitly set by the nth-child rules below, for both normal and hover states. */
  }

  /* Default blog card content/paragraph style */
  .blog-card p { 
    @apply text-base;
    color: #757575; /* A pleasant, eye-friendly light gray - e.g. Google's Material Design secondary text */
    line-height: 1.65; /* Slightly more generous line height for readability */
  }

  /* --- Dynamic Title Colors based on :nth-child for .blog-card --- */
  /* 
  TEMPORARILY COMMENTED OUT FOR DIAGNOSTICS
  .blog-card:nth-child(5n+1) h2 a {
    color: rgba(245, 158, 11, 0.85) !important; 
  }
  .blog-card:nth-child(5n+1):hover h2 a {
    color: rgba(245, 158, 11, 0.95) !important; 
  }

  .blog-card:nth-child(5n+2) h2 a {
    color: rgba(16, 185, 129, 0.85) !important; 
  }
   .blog-card:nth-child(5n+2):hover h2 a {
    color: rgba(16, 185, 129, 0.95) !important; 
  }

  .blog-card:nth-child(5n+3) h2 a {
    color: rgba(124, 58, 237, 0.85) !important; 
  }
  .blog-card:nth-child(5n+3):hover h2 a {
    color: rgba(124, 58, 237, 0.95) !important; 
  }

  .blog-card:nth-child(5n+4) h2 a {
    color: rgba(239, 68, 68, 0.85) !important; 
  }
  .blog-card:nth-child(5n+4):hover h2 a {
    color: rgba(239, 68, 68, 0.95) !important; 
  }

  .blog-card:nth-child(5n+5) h2 a {
    color: rgba(59, 130, 246, 0.85) !important; 
  }
  .blog-card:nth-child(5n+5):hover h2 a {
    color: rgba(59, 130, 246, 0.95) !important; 
  }
  */
  /* --- END OF NEW STYLES --- */
  
  /* 更优雅的分页样式 */
  .pagination {
    @apply px-2 py-2 mt-12 rounded-full;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
  }
  
  .pagination-item {
    @apply flex items-center justify-center w-10 h-10 rounded-full transition-all duration-300;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(4px);
  }
  
  .pagination-item.active {
    @apply text-white font-medium;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
  }
  
  .pagination-item.active::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-color: var(--accent-color);
  }
  
  .pagination-item:not(.active):hover {
    @apply bg-surface-800/30;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  }
  
  /* 飘动的元素动画 */
  .floating-element {
    animation: float 8s ease-in-out infinite;
  }
  
  @keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
  }
  
  /* 诗意的引用样式 */
  .poetic-quote {
    @apply font-display italic text-surface-400 leading-relaxed border-l-2 border-primary-500/30 pl-4 my-6 opacity-85;
  }

  /* Added Pagination Helper Styles */
  .pagination-bar {
    @apply flex items-center justify-center space-x-1 p-2 mt-5 rounded-xl shadow-lg;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    box-shadow: 
      0 4px 15px rgba(0, 0, 0, 0.08),
      0 0 10px rgba(200, 200, 255, 0.12);
  }

  .pagination-button {
    @apply inline-flex items-center justify-center w-9 h-9 rounded-lg text-sm font-medium transition-all duration-200;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: theme('colors.surface.600');
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  }
  .pagination-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: theme('colors.primary.600');
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.07);
  }
  .pagination-button.active {
    @apply text-white shadow-md;
    background-color: theme('colors.primary.500');
    border-color: theme('colors.primary.600');
    box-shadow: 0 0 10px theme('colors.primary.400 / 50%'), 0 0 15px theme('colors.primary.400 / 40%'), 0 2px 5px rgba(0,0,0,0.1);
  }

  .pagination-button-disabled {
    @apply inline-flex items-center justify-center w-9 h-9 rounded-lg text-sm font-medium opacity-40 cursor-not-allowed;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: theme('colors.surface.500');
  }

  .pagination-ellipsis {
    @apply inline-flex items-center justify-center w-9 h-9 text-sm;
    color: theme('colors.surface.500');
  }
}

/* 精致的淡入动画 */
.animate-enter {
  animation: enter 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes enter {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 精美的滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  @apply bg-surface-700/50 rounded-full;
}

::-webkit-scrollbar-thumb:hover {
  @apply bg-surface-600/50;
}

/* 文本截断类 */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 精致的背景纹理 */
.noise-texture {
  position: fixed;
  inset: 0;
  z-index: -20;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.1'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* 全局变量 */
:root {
  /* 基础颜色 - 更高对比度 */
  --text-color: #483e33;
  --muted-color: #7a6c5e;
  --bg-color: #ffffff;
  --accent-color: #7a9dc5;
  --accent-hover: #98bae2;
  
  /* 磨砂玻璃效果参数 */
  --glass-bg: rgba(255, 252, 247, 0.7);
  --glass-border: rgba(255, 252, 247, 0.3);
  --glass-highlight: rgba(255, 252, 247, 0.4);
  --glass-shadow: rgba(97, 87, 72, 0.1);
  
  /* 发光效果颜色 */
  --glow-primary: rgba(163, 191, 217, 0.4);
  --glow-accent: rgba(217, 204, 224, 0.4);
  --glow-rose: rgba(232, 192, 200, 0.4);
  --glow-amber: rgba(233, 210, 183, 0.4);
  
  /* 空间和尺寸 */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  
  /* 动画时间 */
  --transition-slow: 0.7s;
  --transition-medium: 0.4s;
  --transition-fast: 0.2s;
}

/* 全局样式 */
body {
  font-family: 'Inter', sans-serif;
  /* background-color: var(--bg-color); */ /* REMOVED to prevent conflict with background-image */
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  line-height: 1.2;
}

/* 顶部渐变光效 */
.bg-gradient-to-b {
  z-index: -15;
}

/* 树叶飘落动画样式 */
.leaf-container {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  opacity: 1;
  max-height: 90vh; /* 限制高度 */
}

.falling-leaf {
  position: absolute;
  filter: drop-shadow(0 4px 8px rgba(146, 64, 14, 0.6));
  transform-origin: center;
  will-change: transform, opacity;
  backface-visibility: hidden;
  z-index: -1;
}

/* 确保页面主要容器在树叶上方且不会溢出 */
.container, main, header, footer, .blog-card, article, .glass-card {
  position: relative;
  z-index: 2;
  max-width: 100%;
  overflow: hidden; /* 防止溢出 */
}

/* 重置移动树叶的动画，使用JavaScript控制 */
@keyframes fallLeft { 
  0% { opacity: 0; }
  100% { opacity: 0; } 
}

/* 轻柔的悬浮效果 */
.hover-float {
  transition: transform 0.3s ease;
}

.hover-float:hover {
  transform: translateY(-5px);
}

/* 增强导航栏磨砂效果 */
.nav-blur {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-bottom: 1px solid rgba(124, 144, 195, 0.2);
  box-shadow: 0 4px 20px rgba(124, 144, 195, 0.1);
}

/* 页面磨砂玻璃容器 */
.page-glass-container {
  position: relative;
  z-index: 2;
  /* min-height: 100vh; */ /* 移除这个属性，不再强制页面高度至少为100vh */
  height: 100vh; /* 设置绝对高度为100vh */
  overflow-y: hidden; /* 禁止垂直滚动 */
  overflow-x: hidden; /* 禁止水平滚动 */
  /* MODIFIED: Increase transparency and add slight blur for朦胧感 */
  backdrop-filter: blur(4px); 
  -webkit-backdrop-filter: blur(4px); 
  background: rgba(255, 255, 255, 0.3); /* Alpha 0.1 -> 0.3 */
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); 
}

/* 微妙的装饰元素 */
.page-glass-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.8), 
    rgba(255, 255, 255, 0.8), 
    transparent
  );
  z-index: 5;
}

/* 微妙光晕效果 */
.subtle-glow {
  position: fixed;
  width: 40vw;
  height: 40vw;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(126, 156, 214, 0.15) 0%,
    rgba(126, 156, 214, 0) 70%
  );
  filter: blur(50px);
  z-index: -1;
  pointer-events: none;
  transition: all 3s ease;
  opacity: 0.6;
}

.subtle-glow.top-right {
  top: -20vw;
  right: -20vw;
}

.subtle-glow.bottom-left {
  bottom: -20vw;
  left: -20vw;
}

/* 紧凑布局的文章列表 */
.compact-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem;
}

/* 磨砂玻璃效果增强 */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 30px var(--glass-shadow);
}

/* Custom select arrow for date filters */
.styled-select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1em;
  padding-right: 2.5rem; /* Ensure space for the arrow */
}

/* Remove default arrow for Firefox */
.styled-select::-ms-expand {
  display: none;
}

/* Remove default arrow for IE/Edge */
select.styled-select::-ms-expand {
    display: none;
}

.miniblock-title-container:hover .text-xl {
  /* Example: could add a subtle text shadow or other effect */
  /* text-shadow: 0 1px 2px rgba(0,0,0,0.1); */
}

/* If you had specific styles for nav-blur before, ensure they are merged or adjusted */
.nav-container {
  /* The bg-slate-50/80 backdrop-blur-lg in Tailwind handles the frosted glass */
}

/* You can add more specific hover/focus states for inputs/selects if needed */

/* Butterfly Animation Styles */
.butterfly {
  position: absolute;
  /* Outer container: only for positioning and path animation */
  opacity: 0; /* Path animation will control opacity */
  will-change: transform, opacity;
  max-top: 90vh; /* 限制活动范围 */
  max-height: 90vh; /* 限制活动范围 */
  max-width: 100vw; /* 限制活动范围 */
  overflow: hidden; /* 防止溢出 */
}

.butterfly-wings {
  /* Inner container: for SVG background and wing flutter */
  width: 100%;
  height: 100%;
  background-size: contain;
  background-repeat: no-repeat;
  transform-origin: center center;
  animation: flutter 0.4s ease-in-out infinite alternate;
  will-change: transform;
}

/* Specific butterfly types */
.butterfly.b1 {
  width: 40px;
  height: 35px;
  animation: fly-dance 22s ease-in-out infinite; /* Slower, less frequent */
}
.butterfly.b1 .butterfly-wings {
  background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 50 40" xmlns="http://www.w3.org/2000/svg"><defs><radialGradient id="wingGradient" cx="0.5" cy="0.5" r="0.5" fx="0.5" fy="0.5"><stop offset="10%" stop-color="%23FFFFF0" stop-opacity="1"/><stop offset="85%" stop-color="%23FFFACD" stop-opacity="1"/></radialGradient><filter id="shadow" x="-20%" y="-20%" width="140%" height="140%"><feGaussianBlur in="SourceAlpha" stdDeviation="1.2"/><feOffset dx="0.5" dy="0.5"/><feComponentTransfer><feFuncA type="linear" slope="0.2"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge></filter></defs><g stroke-width="1" stroke="%234A4A4A" filter="url(%23shadow)"><path d="M25 16C12 2 2 5 7 18s15 16 18 3M25 16C38 2 48 5 43 18s-15 16-18 3" fill="url(%23wingGradient)"/><path d="M25 18C18 30 15 38 22 38h6c7 0 4-8-3-20" fill="%23FFFACD"/><path d="M20 5A5 3 0 0 1 25 7a5 3 0 0 1 5-2" fill="%23FF9800" stroke="none"/><path d="M15 9L18 15M35 9L32 15M19 12L16 17M31 12L34 17" stroke-width="0.6" stroke-opacity="0.6"/><path d="M23 7A2 2 0 0 1 25 8a2 2 0 0 1 2-1" fill="%23FF5722" stroke="none"/><circle cx="25" cy="19" r="1.5" fill="%234A4A4A" stroke="none"/><ellipse cx="25" cy="23" rx="1.2" ry="2.8" fill="%234A4A4A" stroke="none"/><ellipse cx="25" cy="27" rx="1" ry="2" fill="%234A4A4A" stroke="none"/></g><path d="M23 16A7 7 0 0 0 18 9M27 16A7 7 0 0 1 32 9" stroke="%234A4A4A" stroke-width="0.8" fill="none" stroke-linecap="round"/></svg>');
}

.butterfly.b2 {
  width: 36px; 
  height: 31px;
  animation: fly-dance-alt 25s ease-in-out infinite; /* Slower, less frequent */
}
.butterfly.b2 .butterfly-wings {
  background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 50 40" xmlns="http://www.w3.org/2000/svg"><defs><radialGradient id="wingGradient2" cx="0.5" cy="0.5" r="0.5" fx="0.5" fy="0.5"><stop offset="10%" stop-color="%23F8F8FF" stop-opacity="1"/><stop offset="85%" stop-color="%23E6E6FA" stop-opacity="1"/></radialGradient><filter id="shadow" x="-20%" y="-20%" width="140%" height="140%"><feGaussianBlur in="SourceAlpha" stdDeviation="1.2"/><feOffset dx="0.5" dy="0.5"/><feComponentTransfer><feFuncA type="linear" slope="0.2"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge></filter></defs><g stroke-width="1" stroke="%234A4A4A" filter="url(%23shadow)"><path d="M25 16C12 2 2 6 7 19s13 14 18 1M25 16C38 2 48 6 43 19s-13 14-18 1" fill="url(%23wingGradient2)"/><path d="M25 18C18 30 15 38 22 38h6c7 0 4-8-3-20" fill="%23E6E6FA"/><path d="M20 5A5 3 0 0 1 25 7a5 3 0 0 1 5-2" fill="%239370DB" stroke="none"/><path d="M15 9L18 15M35 9L32 15M19 12L16 17M31 12L34 17" stroke-width="0.6" stroke-opacity="0.5"/><path d="M23 7A2 2 0 0 1 25 8a2 2 0 0 1 2-1" fill="%238A2BE2" stroke="none"/><circle cx="25" cy="19" r="1.5" fill="%234A4A4A" stroke="none"/><ellipse cx="25" cy="23" rx="1.2" ry="2.8" fill="%234A4A4A" stroke="none"/><ellipse cx="25" cy="27" rx="1" ry="2" fill="%234A4A4A" stroke="none"/></g><path d="M23 16A7 7 0 0 0 18 9M27 16A7 7 0 0 1 32 9" stroke="%234A4A4A" stroke-width="0.8" fill="none" stroke-linecap="round"/></svg>');
  animation-name: flutter-alt;
  animation-duration: 0.38s;
}

/* 修改飞行动画，确保不会飞出可见区域 */
@keyframes fly-dance {
  0% {
    transform: translateX(-50px) translateY(10vh) rotate(0deg);
    opacity: 0;
  }
  5% {
    transform: translateX(5vw) translateY(5vh) rotate(15deg);
    opacity: 1;
  }
  15% {
    transform: translateX(20vw) translateY(15vh) rotate(-10deg);
    opacity: 1;
  }
  25% {
    transform: translateX(10vw) translateY(30vh) rotate(20deg);
    opacity: 1;
  }
  35% {
    transform: translateX(25vw) translateY(25vh) rotate(-15deg);
    opacity: 1;
  }
  45% {
    transform: translateX(15vw) translateY(45vh) rotate(10deg); /* 从50vh减少到45vh */
    opacity: 1;
  }
  55% {
    transform: translateX(30vw) translateY(40vh) rotate(-20deg);
    opacity: 1;
  }
  65% {
    transform: translateX(20vw) translateY(55vh) rotate(15deg); /* 从65vh减少到55vh */
    opacity: 1;
  }
  75% {
    transform: translateX(35vw) translateY(45vh) rotate(-10deg); /* 从55vh减少到45vh */
    opacity: 1;
  }
  85% {
    transform: translateX(25vw) translateY(60vh) rotate(5deg); /* 从80vh减少到60vh */
    opacity: 1;
  }
  95% {
    transform: translateX(40vw) translateY(50vh) rotate(-5deg); /* 从70vh减少到50vh */
    opacity: 0.7;
  }
  100% {
    transform: translateX(45vw) translateY(55vh) rotate(0deg); /* 从85vh减少到55vh */
    opacity: 0;
  }
}

/* Alternative flight pattern for the second butterfly (Red Path) */
@keyframes fly-dance-alt {
  0% {
    transform: translateX(-30px) translateY(40vh) rotate(0deg);
    opacity: 0;
  }
  5% {
    transform: translateX(5vw) translateY(35vh) rotate(-15deg);
    opacity: 1;
  }
  15% {
    transform: translateX(15vw) translateY(20vh) rotate(10deg);
    opacity: 1;
  }
  25% {
    transform: translateX(25vw) translateY(30vh) rotate(-20deg);
    opacity: 1;
  }
  35% {
    transform: translateX(10vw) translateY(45vh) rotate(15deg); /* 从50vh减少到45vh */
    opacity: 1;
  }
  45% {
    transform: translateX(30vw) translateY(40vh) rotate(-10deg); /* 从45vh减少到40vh */
    opacity: 1;
  }
  55% {
    transform: translateX(5vw) translateY(50vh) rotate(20deg); /* 从70vh减少到50vh */
    opacity: 1;
  }
  65% {
    transform: translateX(20vw) translateY(45vh) rotate(-15deg); /* 从60vh减少到45vh */
    opacity: 1;
  }
  75% {
    transform: translateX(35vw) translateY(55vh) rotate(10deg); /* 从75vh减少到55vh */
    opacity: 1;
  }
  85% {
    transform: translateX(15vw) translateY(60vh) rotate(-5deg); /* 从90vh减少到60vh */
    opacity: 1;
  }
  95% {
    transform: translateX(45vw) translateY(50vh) rotate(5deg); /* 从85vh减少到50vh */
    opacity: 0.7;
  }
  100% {
    transform: translateX(50vw) translateY(55vh) rotate(0deg); /* 从95vh减少到55vh */
    opacity: 0;
  }
}

/* Enhanced wing flutter animation with more realistic movement */
@keyframes flutter {
  0% { /* Upstroke */
    transform: perspective(600px) rotateY(0deg) rotateX(25deg) scaleY(0.95);
  }
  50% { /* Downstroke */
    transform: perspective(600px) rotateY(5deg) rotateX(-20deg) scaleY(1.05);
  }
  100% { /* Back to Upstroke */
    transform: perspective(600px) rotateY(0deg) rotateX(25deg) scaleY(0.95);
  }
}

/* Alternative wing flutter for second butterfly */
@keyframes flutter-alt {
  0% { /* Upstroke */
    transform: perspective(600px) rotateY(0deg) rotateX(28deg) scale(0.78) scaleY(0.93);
  }
  50% { /* Downstroke */
    transform: perspective(600px) rotateY(-5deg) rotateX(-22deg) scale(0.8) scaleY(1.07);
  }
  100% { /* Back to Upstroke */
    transform: perspective(600px) rotateY(0deg) rotateX(28deg) scale(0.78) scaleY(0.93);
  }
}

/* Sun Animation Styles */
#sun-rays-container {
  position: fixed;
  top: 25px;
  right: 35px;
  width: 280px;
  height: 280px;
  pointer-events: none;
  z-index: 1; /* Ensure it's above leaves if they are at z-index 0 */
}

.sun-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px; 
  height: 60px;
  background: radial-gradient(ellipse at center, #FFFFFF 0%, #FFFDE7 30%, #FFF9C4 60%, #FFECB3 100%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 
    0 0 10px 5px #FFFDE7, 
    0 0 20px 10px #FFF9C4,
    0 0 40px 20px rgba(255, 236, 179, 0.7),
    0 0 70px 35px rgba(255, 224, 130, 0.5),
    0 0 110px 50px rgba(255, 202, 40, 0.3);
  animation: pulse-sun-halo 3.5s ease-in-out infinite alternate;
}

@keyframes pulse-sun-halo {
  0% {
    transform: translate(-50%, -50%) scale(0.97);
    box-shadow: 
      0 0 8px 4px #FFFDE7,
      0 0 18px 9px #FFF9C4,
      0 0 35px 18px rgba(255, 236, 179, 0.65),
      0 0 65px 32px rgba(255, 224, 130, 0.45),
      0 0 100px 45px rgba(255, 202, 40, 0.25);
  }
  100% {
    transform: translate(-50%, -50%) scale(1.03);
    box-shadow: 
      0 0 12px 6px #FFFDE7,
      0 0 22px 11px #FFF9C4,
      0 0 45px 22px rgba(255, 236, 179, 0.75),
      0 0 75px 38px rgba(255, 224, 130, 0.55),
      0 0 120px 55px rgba(255, 202, 40, 0.35);
  }
}

.sun-ray {
  position: absolute;
  bottom: 50%; /* Originates from sun center */
  left: calc(50% - 1.5px); /* Width 3px, so offset by 1.5px */
  width: 3px; /* Thinner rays */
  height: 180px; /* Base length of rays */
  background: linear-gradient(to top, rgba(255, 235, 156, 0.6) 0%, rgba(255, 245, 224, 0) 100%);
  transform-origin: bottom center;
  opacity: 0;
  border-radius: 1.5px;
  /* General animation properties - individual delays and rotations will be per :nth-child */
  animation-name: shine-ray-directional;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

/* Keyframes for ray shining - CSS variables are no longer set by JS for this version */
@keyframes shine-ray-directional {
  0%, 100% {
    opacity: 0;
    transform: rotate(var(--angle)) scaleY(0.7);
  }
  10% {
    opacity: 0.5; /* Default peak opacity, can be overridden by :nth-child */
    transform: rotate(var(--angle)) scaleY(0.85);
  }
  50% { 
    opacity: 0.5;
    transform: rotate(var(--angle)) scaleY(1.0);
  }
  70% {
    opacity: 0.25;
    transform: rotate(var(--angle)) scaleY(0.85);
  }
}

/* Styling for 8 individual rays using :nth-child */
/* Rays point from sun (top-right) to bottom-left. */
/* For transform-origin: bottom center, angle 0 is UP. */
/* Angle range: approx 200 to 250 degrees (SW direction). Spread over 8 rays. */

.sun-ray:nth-child(1) {
  transform: rotate(200deg); 
  animation-duration: 4.5s; 
  animation-delay: -0.5s; 
  --angle: 200deg; /* For use in keyframes */
}
.sun-ray:nth-child(2) {
  transform: rotate(207deg);
  animation-duration: 5s; 
  animation-delay: -1.2s; 
  --angle: 207deg;
}
.sun-ray:nth-child(3) {
  transform: rotate(214deg);
  animation-duration: 4.2s; 
  animation-delay: -0.2s; 
  --angle: 214deg;
}
.sun-ray:nth-child(4) {
  transform: rotate(221deg);
  animation-duration: 5.3s; 
  animation-delay: -1.8s; 
  --angle: 221deg;
}
.sun-ray:nth-child(5) {
  transform: rotate(228deg);
  animation-duration: 4.0s; 
  animation-delay: -0.8s; 
  --angle: 228deg;
}
.sun-ray:nth-child(6) {
  transform: rotate(235deg);
  animation-duration: 5.1s; 
  animation-delay: -1.5s; 
  --angle: 235deg;
}
.sun-ray:nth-child(7) {
  transform: rotate(242deg);
  animation-duration: 4.7s; 
  animation-delay: -0.3s; 
  --angle: 242deg;
}
.sun-ray:nth-child(8) {
  transform: rotate(249deg);
  animation-duration: 5.5s; 
  animation-delay: -2.0s; 
  --angle: 249deg;
}

/* 蝴蝶容器 */
#butterfly-sanctuary {
  position: fixed;
  top: 0;
  left: 0;
  width: 25%; /* 更改宽度从1/4到25% */
  height: 90vh; /* 限制高度 */
  pointer-events: none;
  z-index: 10;
  opacity: 0.8;
  overflow: hidden; /* 防止溢出 */
}

/* 单篇文章页面样式 - 允许滚动 */
.article-page-body {
  overflow-y: auto !important;
  max-height: none !important;
  height: auto !important;
  overflow-x: hidden !important;
  position: relative !important;
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
}

/* 添加一个新的类用于全局重置滚动样式 */
.enable-scroll {
  overflow-y: auto !important;
  max-height: none !important;
  height: auto !important;
  overflow-x: hidden !important;
}

/* 管理员下拉菜单样式 */
#admin-actions, #admin-actions-fallback {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
  min-width: 10rem;
}

#admin-actions option, #admin-actions-fallback option {
  padding: 0.5rem;
  font-size: 0.875rem;
}

/* 调整首页样式 */
.nav-container {
  z-index: 100; /* 确保导航栏在其他元素之上 */
  position: relative;
}

/* 移动模式下调整样式 */
@media (max-width: 768px) {
  #admin-actions, #admin-actions-fallback {
    max-width: 150px;
  }
}